#include "Scene.h"


Scene::Scene() {
}

Scene::Scene(int i) {
	this->sceneNumber = i;
	
	impostorX0 = -50;
	impostorX1 = 50;
	impostorY0 = -20;
	impostorY1 = 90;
	impostorZ0 = -50;
	impostorZ1 = 50;
}

Scene::~Scene() {

}


void Scene::changeScene(GLUquadric* glQ, int d) {
	this->sceneNumber = d;
	drawScene(glQ);
}

void Scene::drawTable1Leg(float x, float y, float z, int txId) {
	float tX, tY, tZ;

	tX = x/(4.0*15.0);
	tY = y/4.0;
	tZ = z/(4.0*15.0);

	glBegin(GL_POLYGON);
		glNormal3d(1.0, 0.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x ,0.0 ,-z);
		glTexCoord2f(tY,0.0); glVertex3f(-x,0.0,z);
		glTexCoord2f(tY,tZ); glVertex3f(-x,y,z);
		glTexCoord2f(0.0,tZ); glVertex3f(-x,y, -z);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(0.0, 0.0, 1.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x, 0.0, z);
		glTexCoord2f(tZ,0.0); glVertex3f(x, 0.0, z);
		glTexCoord2f(tZ,tY); glVertex3f(x, y, z);
		glTexCoord2f(0.0,tY); glVertex3f(-x, y, z);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(0.0, 0.0, 1.0);
		glTexCoord2f(0.0,0.0); glVertex3f(x, 0.0, z);
		glTexCoord2f(tZ,tY); glVertex3f(x, 0.0, -z);
		glTexCoord2f(tZ,tY); glVertex3f(x, y, -z);
		glTexCoord2f(0.0,1.0); glVertex3f(x, y, z);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(0.0, 1.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(x, 0.0,  -z);
		glTexCoord2f(1.0,0.0); glVertex3f(-x, 0.0, -z);
		glTexCoord2f(1.0,1.0); glVertex3f(-x, y, -z);
		glTexCoord2f(0.0,1.0); glVertex3f(x, y, -z);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(1.0, 0.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x, 0.0,  -z);
		glTexCoord2f(1.0,0.0); glVertex3f(x, 0.0, -z);
		glTexCoord2f(1.0,1.0); glVertex3f(x, 0.0, z);
		glTexCoord2f(0.0,1.0); glVertex3f(-x, 0.0, z);
	glEnd();

}

void Scene::drawTable1(GLUquadric* glQ, float x, float y, float z, int txId) {
	float tX, tY, tZ;
	Material wood;
	
	wood.ambient[0] = 1;
	wood.ambient[1] = 1;
	wood.ambient[2] = 1;
	wood.ambient[3] = 1.0;
	wood.emission[0] = 0.0;
	wood.emission[1] = 0.0;
	wood.emission[2] = 0.0;
	wood.emission[3] = 0.0;
	wood.diffuse[0] = 1;
	wood.diffuse[1] = 1;
	wood.diffuse[2] = 1;
	wood.diffuse[3] = 1;
	wood.specular[0] = 0.4;
	wood.specular[1] = 0.4;
	wood.specular[2] = 0.4;
	wood.specular[3] = 1.0;
	wood.shininess[0] = 76.8;
	wood.applyMaterial();

	tX = x/4.0;
	tY = y/4.0;
	tZ = z/4.0;

	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D, 3);
	glPushMatrix();
	glFrontFace(GL_CW);
	glTranslatef(-12.0, 1.5, 0.0);
	glutSolidTeapot(1.8);
	glDisable(GL_CULL_FACE);    
	glTranslatef(0.0, 1.5, 10.0);
	glRotated(90.0, 1.0, 0.0, 0.0);
	gluCylinder(glQ, 0.8, 0.8, 3.0, 50, 50);
	glTranslatef(0.0, -18.0, 0.0);
	gluCylinder(glQ, 0.8, 0.8, 3.0, 50, 50);
	glPopMatrix();
	glFrontFace(GL_CCW);
	glEnable(GL_CULL_FACE);  


	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D, txId);

	glBegin(GL_POLYGON);
		glNormal3d(0.0, 1.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x,-0.1,z);
		glTexCoord2f(1.0,0.0); glVertex3f(x,-0.1,z);
		glTexCoord2f(1.0,1.0); glVertex3f(x,-0.1,-z);
		glTexCoord2f(0.0,1.0); glVertex3f(-x,-0.1,-z);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(0.0, 1.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x,-y/10.0,-z);
		glTexCoord2f(1.0,0.0); glVertex3f(-x,-y/10.0,z);
		glTexCoord2f(1.0,1.0); glVertex3f(x,-y/10.0,z);
		glTexCoord2f(0.0,1.0); glVertex3f(x,-y/10.0,-z);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(0.0, 0.0, 1.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x,-y/10.0,z);
		glTexCoord2f(1.0,0.0); glVertex3f(x,-y/10.0,z);
		glTexCoord2f(1.0,1.0); glVertex3f(x,-0.1,z);
		glTexCoord2f(0.0,1.0); glVertex3f(-x,-0.1,z);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(0.0, 0.0, 1.0);
		glTexCoord2f(0.0,0.0); glVertex3f(x,-y/10.0,-z);
		glTexCoord2f(1.0,0.0); glVertex3f(-x,-y/10.0,-z);
		glTexCoord2f(1.0,1.0); glVertex3f(-x,-0.1,-z);
		glTexCoord2f(0.0,1.0); glVertex3f(x,-0.1,-z);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(1.0, 0.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x,-y/10.0,-z);
		glTexCoord2f(1.0,0.0); glVertex3f(-x,-y/10.0,z);
		glTexCoord2f(1.0,1.0); glVertex3f(-x,-0.1,z);
		glTexCoord2f(0.0,1.0); glVertex3f(-x,-0.1,-z);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(1.0, 0.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(x,-y/10.0,z);
		glTexCoord2f(1.0,0.0); glVertex3f(x,-y/10.0,-z);
		glTexCoord2f(1.0,1.0); glVertex3f(x,-0.1,-z);
		glTexCoord2f(0.0,1.0); glVertex3f(x,-0.1,z);
	glEnd();

	
	glPushMatrix();
	glTranslatef(-x + x/20.0, -y, z - z/20.0);
	drawTable1Leg(x/20.0, y - y/10.0, z/20.0, txId);
	glPopMatrix();
	glPushMatrix();
	glTranslatef(x - x/20.0, -y, z - z/20.0);
	drawTable1Leg(x/15.0, y - y/10.0, z/20.0, txId);
	glPopMatrix();
	glPushMatrix();
	glTranslatef(-x + x/20.0, -y, -z + z/20.0);
	drawTable1Leg(x/20.0, y - y/10.0, z/20.0, txId);
	glPopMatrix();
	glPushMatrix();
	glTranslatef(x - x/20.0, -y, - z + z/20.0);
	drawTable1Leg(x/20.0, y - y/10.0, z/20.0, txId);
	glPopMatrix();

	glDisable(GL_TEXTURE_2D);
}


void drawCup(GLUquadric* glQ) {
	
}

void Scene::drawTable2(GLUquadric* glQ) {
	drawTable2Top(glQ, 13.0, 1.0, 50, 50);
	drawTable2Leg(glQ, 0.5, 15.0, 50, 50);

	glPushMatrix();
	glTranslated(0.0, -5.0, 0.0);
	drawFloor(3);
	glPopMatrix();
}

void Scene::drawTable2Leg(GLUquadric* glQ, float radius, float height, int nSlices, int nStacks){

	Material white = Material();
	white.ambient[0] = 1;
	white.ambient[1] = 1;
	white.ambient[2] = 1;
	white.ambient[3] = 1.0;
	white.emission[0] = 0.0;
	white.emission[1] = 0.0;
	white.emission[2] = 0.0;
	white.emission[3] = 0.0;
	white.diffuse[0] = 1;
	white.diffuse[1] = 1;
	white.diffuse[2] = 1;
	white.diffuse[3] = 1;
	white.specular[0] = 0.4;
	white.specular[1] = 0.4;
	white.specular[2] = 0.4;
	white.specular[3] = 1.0;
	white.shininess[0] = 76.8;
	white.applyMaterial();

	glPushMatrix();
	glRotated(90.0, 1.0, 0.0, 0.0);
	gluCylinder(glQ, radius, radius, height, nSlices, nStacks);
	gluDisk (glQ, 0.0, radius, nSlices, nStacks);
	glPopMatrix();
}

void Scene::drawTable2Top(GLUquadric* glQ, float radius, float height, int nSlices, int nStacks){
	Material black = Material();
	black.ambient[0] = 0;
	black.ambient[1] = 0;
	black.ambient[2] = 0;
	black.ambient[3] = 1.0;
	black.emission[0] = 0.0;
	black.emission[1] = 0.0;
	black.emission[2] = 0.0;
	black.emission[3] = 0.0;
	black.diffuse[0] = 0;
	black.diffuse[1] = 0;
	black.diffuse[2] = 0;
	black.diffuse[3] = 1;
	black.specular[0] = 0.0;
	black.specular[1] = 0.0;
	black.specular[2] = 0.0;
	black.specular[3] = 1.0;
	black.shininess[0] = 76.8;
	black.applyMaterial();
	glPushMatrix();
	glTranslated(0.0, -0.1, 0.0);
	glRotated(90.0, 1.0, 0.0, 0.0);
	gluCylinder(glQ, radius, radius, height, nSlices, nStacks);
	glRotated(180.0, 1.0, 0.0, 0.0);
	gluDisk (glQ, 0.0, radius, nSlices, nStacks);
	glPopMatrix();
	glPushMatrix();
	glTranslated(0.0, - height, 0.0);
	glRotated(90.0, 1.0, 0.0, 0.0);
	gluDisk (glQ, 0.0, radius, nSlices, nStacks);
	glPopMatrix();
	glDisable(GL_COLOR_MATERIAL);
}

void drawTable2Base(float x, float y, float z, int txId) {
	float tX, tY, tZ;
	tX = x/4.0;
	tY = y/4.0;
	tZ = z/4.0;

	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D, txId);
	
	glBegin(GL_POLYGON);
		glNormal3d(0.0, 1.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x,-1.0,z);
		glTexCoord2f(1.0,0.0); glVertex3f(x,-1.0,z);
		glTexCoord2f(1.0,1.0); glVertex3f(x,-1.0,-z);
		glTexCoord2f(0.0,1.0); glVertex3f(-x,-1.0,-z);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(0.0, 1.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x,-y/10.0,-z);
		glTexCoord2f(1.0,0.0); glVertex3f(-x,-y/10.0,z);
		glTexCoord2f(1.0,1.0); glVertex3f(x,-y/10.0,z);
		glTexCoord2f(0.0,1.0); glVertex3f(x,-y/10.0,-z);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(0.0, 0.0, 1.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x,-y/10.0,z);
		glTexCoord2f(1.0,0.0); glVertex3f(x,-y/10.0,z);
		glTexCoord2f(1.0,1.0); glVertex3f(x,-1.0,z);
		glTexCoord2f(0.0,1.0); glVertex3f(-x,-1.0,z);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(0.0, 0.0, 1.0);
		glTexCoord2f(0.0,0.0); glVertex3f(x,-y/10.0,-z);
		glTexCoord2f(1.0,0.0); glVertex3f(-x,-y/10.0,-z);
		glTexCoord2f(1.0,1.0); glVertex3f(-x,-1.0,-z);
		glTexCoord2f(0.0,1.0); glVertex3f(x,-1.0,-z);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(1.0, 0.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x,-y/10.0,-z);
		glTexCoord2f(1.0,0.0); glVertex3f(-x,-y/10.0,z);
		glTexCoord2f(1.0,1.0); glVertex3f(-x,-1.0,z);
		glTexCoord2f(0.0,1.0); glVertex3f(-x,-1.0,-z);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(1.0, 0.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(x,-y/10.0,z);
		glTexCoord2f(1.0,0.0); glVertex3f(x,-y/10.0,-z);
		glTexCoord2f(1.0,1.0); glVertex3f(x,-1.0,-z);
		glTexCoord2f(0.0,1.0); glVertex3f(x,-1.0,z);
	glEnd();

	glDisable(GL_TEXTURE_2D);

}


void Scene::drawBox(float x) {
	glBegin(GL_POLYGON);
		glNormal3d(0.0, 1.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x,-0.1,x);
		glTexCoord2f(1.0,0.0); glVertex3f(x,-0.1,x);
		glTexCoord2f(1.0,1.0); glVertex3f(x,-0.1,-x);
		glTexCoord2f(0.0,1.0); glVertex3f(-x,-0.1,-x);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(0.0, 1.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x,-2*x,-x);
		glTexCoord2f(1.0,0.0); glVertex3f(x,-2*x,-x);
		glTexCoord2f(1.0,1.0); glVertex3f(x,-2*x,x);
		glTexCoord2f(0.0,1.0); glVertex3f(-x,-2*x,x);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(0.0, 0.0, 1.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x,-2*x,x);
		glTexCoord2f(1.0,0.0); glVertex3f(x,-2*x,x);
		glTexCoord2f(1.0,1.0); glVertex3f(x,-0.1, x);
		glTexCoord2f(0.0,1.0); glVertex3f(-x,-0.1,x);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(0.0, 0.0, 1.0);
		glTexCoord2f(0.0,0.0); glVertex3f(x,-2*x,-x);
		glTexCoord2f(1.0,0.0); glVertex3f(-x,-2*x,-x);
		glTexCoord2f(1.0,1.0); glVertex3f(-x,-0.1,-x);
		glTexCoord2f(0.0,1.0); glVertex3f(x,-0.1,-x);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(1.0, 0.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-x,-x*2,-x);
		glTexCoord2f(1.0,0.0); glVertex3f(-x,-x*2.0,x);
		glTexCoord2f(1.0,1.0); glVertex3f(-x,-0.1,x);
		glTexCoord2f(0.0,1.0); glVertex3f(-x,-0.1,-x);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(1.0, 0.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(x,-2*x,x);
		glTexCoord2f(1.0,0.0); glVertex3f(x,-2*x,-x);
		glTexCoord2f(1.0,1.0); glVertex3f(x,-0.1,-x);
		glTexCoord2f(0.0,1.0); glVertex3f(x,-0.1,x);
	glEnd();

	glDisable(GL_COLOR_MATERIAL);
}

void Scene::drawFloor(int txId) {
	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D, txId);

	glBegin(GL_POLYGON);
		glNormal3d(0.0, 1.0, 0.0);
		glTexCoord2f(0.0,0.0); glVertex3f(-50.0,-10.0,50.0);
		glTexCoord2f(10.0,0.0); glVertex3f(50.0,-10.0,50.0);
		glTexCoord2f(10.0,10.0); glVertex3f(50.0,-10.0,-50.0);
		glTexCoord2f(0.0,10.0); glVertex3f(-50.0,-10.0,-50.0);
	glEnd();

	glDisable(GL_TEXTURE_2D);
}

void Scene::impostors(int txId){
	Material wall;
	wall.ambient[0] = 1;
	wall.ambient[1] = 1;
	wall.ambient[2] = 1;
	wall.ambient[3] = 1.0;
	wall.emission[0] = 0.0;
	wall.emission[1] = 0.0;
	wall.emission[2] = 0.0;
	wall.emission[3] = 0.0;
	wall.diffuse[0] = 1;
	wall.diffuse[1] = 1;
	wall.diffuse[2] = 1;
	wall.diffuse[3] = 1;
	wall.specular[0] = 0.4;
	wall.specular[1] = 0.4;
	wall.specular[2] = 0.4;
	wall.specular[3] = 1.0;
	wall.shininess[0] = 76.8;
	wall.applyMaterial();

	float tX, tY, tZ;
	tX = (impostorX1 - impostorX0)/15.0;
	tY = (impostorY1 - impostorY0)/15.0;
	tZ = (impostorZ1 - impostorZ0)/15.0;

	glEnable(GL_TEXTURE_2D);
	glBindTexture(GL_TEXTURE_2D, txId);

	glBegin(GL_POLYGON);
		glNormal3d(0,0,1);
		glTexCoord2f(0.0,0.0); glVertex3d(impostorX0,impostorY0,impostorZ0);
		glTexCoord2f(tX,0.0); glVertex3d(impostorX1,impostorY0,impostorZ0);
		glTexCoord2f(tX,tY); glVertex3d(impostorX1,impostorY1,impostorZ0);
		glTexCoord2f(0.0,tY); glVertex3d(impostorX0,impostorY1,impostorZ0);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(1,0,0);
		glTexCoord2f(0.0,0.0); glVertex3d(impostorX0,impostorY0,impostorZ1);
		glTexCoord2f(tZ,0.0); glVertex3d(impostorX0,impostorY0,impostorZ0);
		glTexCoord2f(tZ,tY); glVertex3d(impostorX0,impostorY1,impostorZ0);
		glTexCoord2f(0.0,tY); glVertex3d(impostorX0,impostorY1,impostorZ1);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(0,0,1);
		glTexCoord2f(0.0,0.0); glVertex3d(impostorX1,impostorY0,impostorZ1);
		glTexCoord2f(tX, 0.0); glVertex3d(impostorX0,impostorY0,impostorZ1);
		glTexCoord2f(tX,tY); glVertex3d(impostorX0,impostorY1,impostorZ1);
		glTexCoord2f(0.0, tY); glVertex3d(impostorX1,impostorY1,impostorZ1);
	glEnd();

	glBegin(GL_POLYGON);
		glNormal3d(1,0,0);
		glTexCoord2f(0.0,0.0); glVertex3d(impostorX1,impostorY0,impostorZ0);
		glTexCoord2f(tZ,0.0); glVertex3d(impostorX1,impostorY0,impostorZ1);
		glTexCoord2f(tZ,tY); glVertex3d(impostorX1,impostorY1,impostorZ1);
		glTexCoord2f(0.0, tZ); glVertex3d(impostorX1,impostorY1,impostorZ0);
	glEnd();

	glDisable(GL_TEXTURE_2D);
}

void Scene::drawScene1(GLUquadric* glQ) {
	drawTable1(glQ, 15.0, 10.0, 15.0, 2);
	drawFloor(4);
	impostors(5);
}

void Scene::drawScene2(GLUquadric* glQ) {
	drawTable2(glQ);
	impostors(6);
}

void Scene::drawScene3(GLUquadric* glQ) {
	Material red, blue, green, turquoise, ruby, grey;
	red.ambient[0] = 1;
	red.ambient[1] = 0;
	red.ambient[2] = 0;
	red.ambient[3] = 1.0;
	red.emission[0] = 0.0;
	red.emission[1] = 0.0;
	red.emission[2] = 0.0;
	red.emission[3] = 0.0;
	red.diffuse[0] = 1;
	red.diffuse[1] = 0;
	red.diffuse[2] = 0;
	red.diffuse[3] = 1;
	red.specular[0] = 0.4;
	red.specular[1] = 0.0;
	red.specular[2] = 0.0;
	red.specular[3] = 1.0;
	red.shininess[0] = 76.8;
	red.applyMaterial();
	drawBox(15);

	blue.ambient[0] = 1;
	blue.ambient[1] = 0;
	blue.ambient[2] = 1;
	blue.ambient[3] = 1.0;
	blue.emission[0] = 0.0;
	blue.emission[1] = 0.0;
	blue.emission[2] = 0.0;
	blue.emission[3] = 0.0;
	blue.diffuse[0] = 0;
	blue.diffuse[1] = 0;
	blue.diffuse[2] = 1;
	blue.diffuse[3] = 1;
	blue.specular[0] = 0.0;
	blue.specular[1] = 0.0;
	blue.specular[2] = 0.4;
	blue.specular[3] = 1.0;
	blue.shininess[0] = 76.8;
	blue.applyMaterial();
	glPushMatrix();
	glScaled(0.5, 1.8, 1.0);
	glTranslated(30.0, 0.0, -20.0);
	drawBox(20);
	glPopMatrix();

	green.ambient[0] = 0;
	green.ambient[1] = 1;
	green.ambient[2] = 0;
	green.ambient[3] = 1.0;
	green.emission[0] = 0.0;
	green.emission[1] = 0.0;
	green.emission[2] = 0.0;
	green.emission[3] = 0.0;
	green.diffuse[0] = 0;
	green.diffuse[1] = 1;
	green.diffuse[2] = 0;
	green.diffuse[3] = 1;
	green.specular[0] = 0.0;
	green.specular[1] = 0.4;
	green.specular[2] = 0.4;
	green.specular[3] = 1.0;
	green.shininess[0] = 76.8;
	green.applyMaterial();

	glPushMatrix();
	glScaled(0.5, 0.8, 1.7);
	glTranslated(-35.0, 15.0, -25.0);
	drawBox(15);
	glPopMatrix();

	turquoise.ambient[1] = 0.1;
	turquoise.ambient[2] = 0.18725;
	turquoise.ambient[3] = 0.1745;
	turquoise.emission[0] = 0.0;
	turquoise.emission[1] = 0.0;
	turquoise.emission[2] = 0.0;
	turquoise.emission[3] = 0.0;
	turquoise.diffuse[0] = 0.396;
	turquoise.diffuse[1] = 1.74151;
	turquoise.diffuse[2] = 0.69102;
	turquoise.diffuse[3] = 1;
	turquoise.specular[0] = 0.297254;
	turquoise.specular[1] = 0.30829;
	turquoise.specular[2] = 0.306678;
	turquoise.specular[3] = 1.0;
	turquoise.shininess[0] = 0.1;
	turquoise.applyMaterial();
	glPushMatrix();
	glScaled(1.0, 1.0, 2.0);
	glTranslated(0.0, 0.0, -30.0);
	drawBox(15);
	glDisable(GL_COLOR_MATERIAL);
	glPopMatrix();

	ruby.ambient[1] = 0.1745;
	ruby.ambient[2] = 0.01175;
	ruby.ambient[3] = 0.01175;
	ruby.emission[0] = 0.0;
	ruby.emission[1] = 0.0;
	ruby.emission[2] = 0.0;
	ruby.emission[3] = 0.0;
	ruby.diffuse[0] = 0.61424;
	ruby.diffuse[1] = 0.04136;
	ruby.diffuse[2] = 0.4136;
	ruby.diffuse[3] = 1;
	ruby.specular[0] = 0.727811;
	ruby.specular[1] = 0.626959;
	ruby.specular[2] = 0.626959;
	ruby.specular[3] = 1.0;
	ruby.shininess[0] = 0.6;
	ruby.applyMaterial();
	glEnable(GL_COLOR_MATERIAL);
	glColor3f(1.0, 0.0, 1.0);
	glPushMatrix();
	glTranslated(-35.0, 10.0, -25.0);
	drawBox(10);
	glPopMatrix();


	red.applyMaterial();
	glPushMatrix();
	glScaled(0.5, 0.8, 1.7);
	glTranslated(-30.0, 5.0, -20.0);
	drawBox(15);
	glDisable(GL_COLOR_MATERIAL);
	glPopMatrix();
	
	grey.ambient[0] = 0;
	grey.ambient[1] = 0;
	grey.ambient[2] = 0;
	grey.ambient[3] = 1.0;
	grey.emission[0] = 0.0;
	grey.emission[1] = 0.0;
	grey.emission[2] = 0.0;
	grey.emission[3] = 0.0;
	grey.diffuse[0] = 0.5;
	grey.diffuse[1] = 0.5;
	grey.diffuse[2] = 0.5;
	grey.diffuse[3] = 1;
	grey.specular[0] = 0.6;
	grey.specular[1] = 0.6;
	grey.specular[2] = 0.5;
	grey.specular[3] = 1.0;
	grey.shininess[0] = 76.8;
	grey.applyMaterial();
	drawBox(15);

	glPushMatrix();
	glTranslated(-40.0, -5.0, 30.0);
	drawBox(15);
	glDisable(GL_COLOR_MATERIAL);
	glPopMatrix();

}

void Scene::drawScene4(GLUquadric* glQ) {
	Material black;
	glPushMatrix();
	

	glScaled(1.0, 0.05, 1.0);
	//black.applyMaterial();
	drawBox(17);
	glPopMatrix();
}

void Scene::drawScene(GLUquadric* glQ) {
	switch(sceneNumber) {
	case (1):
		drawScene1(glQ);
		break;
	case (2):
		drawScene2(glQ);
		break;
	case (3):
		drawScene3(glQ);
		break;
	case (4):
		drawScene4(glQ);
		break;

	}
}

